<template>
	<view class="page">
		<view class="code-get" >
			<view class="phone">
				<input v-model="phone" type="tel" maxlength="11" placeholder="请输入手机号"/>
			</view>
			
			<view class="btn" @click="submite">
				<text>提交</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isSetting: false,
				phone:''
			};
		},
		onLoad(e) {
			let that = this
			that.phone = e.phone
			uni.setNavigationBarTitle({
				title: e.phone ? '修改手机号':'绑定手机号'
			})
		},
		methods:{
		  submite(){
		  	let that = this
		  	that.tui.request("api.auth.center/updatePhone", "POST", {phone:that.phone}, false, false, true).then((res) => {
				that.tui.toast(res.info)
		  		if(res.code==1){
		  			setTimeout(function(){
						uni.navigateBack()
					},1000)
		  		}
		  	}).catch((res) => {
		  		
		  	})
		  },
		
		}
	}
</script>

<style scoped lang="scss">
	@import 'ModifyPhone.scss';
</style>
